#ifndef JGLVIDEO_H
#define JGLVIDEO_H

#include <QObject>
#include "AviFile.h"
#include "gl\gl.h"

class JGLWidget;

class JGLVideo : public QObject
{
	Q_OBJECT

public:
	JGLVideo( const JGLWidget* viewer, 
		LPCTSTR lpszOutputMovieFileName = _T("Output.avi"), 
		int nFrameWidth = GetSystemMetrics(SM_CXSCREEN),	/*Movie Frame Width*/
		int nFrameHeight = GetSystemMetrics(SM_CYSCREEN),	/*Movie Frame Height*/
		DWORD dwFrameRate = 30,								/*Frames Per Second (FPS)*/
		int nBitsPerPixel = 24,								/*Bits Per Pixel*/
		DWORD dwCodec = mmioFOURCC('C','V','I','D'));		/*Video Codec for Frame Compression*/
	~JGLVideo();

	void startRecording() {m_bRecord = true;}
	void stopRecording()  {m_bRecord = false;}

public slots:
	void draw();

private:
	CAviFile	m_MovieFile;		/*Movie File Object*/
	int			m_nWidth;			/*Movie Frame Width*/
	int			m_nHeight;			/*Movie Frame Height*/
	int			m_nBitsPerPixel;	/*Number of Bits per Pixel*/
	LPVOID		m_pBits;			/*Pointer to Memory required to hold the Frame Content*/

	bool		m_bRecord;			/*Record?*/
};

#endif // JGLVIDEO_H
